<template>
  <div>
    <template>
      <el-table
          :data="tableData"
          style="width: 100%"
          :row-class-name="tableRowClassName">
        <el-table-column
            prop="processDefinitionName"
            label="审批类型"
            width="180">
        </el-table-column>
        <el-table-column
            prop="startUser.name"
            label="发起人"
            width="180">
        </el-table-column>

        <el-table-column
            prop="startTime"
            label="任务节点名"
            width="180">
        </el-table-column>

        <el-table-column
            prop="taskCreateTime"
            label="任务开始时间"
            width="180">
        </el-table-column>

        <el-table-column
            prop="currentActivityName"
            label="处理完成时间"
            width="180">
        </el-table-column>

        <el-table-column
            prop="businessStatus"
            label="处理耗时"
            width="180">
        </el-table-column>

        <el-table-column
            prop="address"
            label="处理结果">
        </el-table-column>
      </el-table>
    </template>
  </div>
</template>

<!--<script>-->

<!--export default {-->
<!--  name: "Pending"-->
<!--}-->
<!--</script>-->
<style>
.el-table .warning-row {
  background: oldlace;
}

.el-table .success-row {
  background: #f0f9eb;
}
</style>

<script>
import  { todoList } from "@/api/design.js"

export default {
  data() {
    return {
      tableData: [],
    }
  },
  mounted() {
    this.getTodoList()
  },
  methods: {
    getTodoList() {
      const param = {
        "pageNo": 1,
        "pageSize": 50
      }
      todoList(param).then(rsp => {
        this.tableData = rsp.data.result.records
        this.total = rsp.data.result.total
      })
    },
    tableRowClassName({row, rowIndex}) {
      if (rowIndex === 1) {
        return 'warning-row';
      } else if (rowIndex === 3) {
        return 'success-row';
      }
      return '';
    }
  },

}
</script>

<style scoped>

</style>